package pattern.behavior.observer;

/**
 * @author : Rookie
 * @description : 具体的观察者
 * @date : 2023/8/26
 */
public class ConcreteObserver implements Observer{

    private String name;
    private Subject subject;

    public ConcreteObserver(String name, Subject subject) {
        this.name = name;
        this.subject = subject;
    }

    @Override
    public void update() {
        System.out.println(name + " received an update from the subject.");
        // 具体的更新操作...
    }
}
